import { S } from '../../s';
import { IPSAppCodeList } from '../../app/codelist/ipsapp-code-list';
import { IPSAppDEField } from '../../app/dataentity/ipsapp-defield';
import { PSMDAjaxControlContainerImpl2 } from '../psmdajax-control-container-impl2';
import { IPSDEDataView } from './ipsdedata-view';
import { IPSDEDataViewDataItem } from './ipsdedata-view-data-item';
import { IPSDEDataViewItem } from './ipsdedata-view-item';
import { IPSLayoutPanel } from '../panel/ipslayout-panel';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysCss } from '../../res/ipssys-css';
import { IPSSysPFPlugin } from '../../res/ipssys-pfplugin';
import { IPSUIActionGroup } from '../../view/ipsuiaction-group';

export class PSDEDataViewImpl
  extends PSMDAjaxControlContainerImpl2
  implements IPSDEDataView
{
  get cardColLG(): number {
    return this.M.cardColLG != null ? this.M.cardColLG : -1;
  }

  get cardColMD(): number {
    return this.M.cardColMD != null ? this.M.cardColMD : -1;
  }

  get cardColSM(): number {
    return this.M.cardColSM != null ? this.M.cardColSM : -1;
  }

  get cardColXS(): number {
    return this.M.cardColXS != null ? this.M.cardColXS : -1;
  }

  get cardHeight(): number {
    return this.M.cardHeight != null ? this.M.cardHeight : 0;
  }

  get cardWidth(): number {
    return this.M.cardWidth != null ? this.M.cardWidth : 0;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get emptyText(): string {
    return this.M.emptyText;
  }

  protected emptytextpslanguageres: IPSLanguageRes;
  getEmptyTextPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.emptytextpslanguageres ||
      (this.emptytextpslanguageres = this.fillObjectModel(
        S._276,
        this.M.getEmptyTextPSLanguageRes,
        S._2b4,
      ) as IPSLanguageRes)
    );
  }

  get groupColLG(): number {
    return this.M.groupColLG != null ? this.M.groupColLG : -1;
  }

  get groupColMD(): number {
    return this.M.groupColMD != null ? this.M.groupColMD : -1;
  }

  get groupColSM(): number {
    return this.M.groupColSM != null ? this.M.groupColSM : -1;
  }

  get groupColXS(): number {
    return this.M.groupColXS != null ? this.M.groupColXS : -1;
  }

  get groupHeight(): number {
    return this.M.groupHeight != null ? this.M.groupHeight : 0;
  }

  get groupLayout(): 'ROW' | 'COLUMN' {
    return this.M.groupLayout;
  }

  get groupMode(): 'NONE' | 'AUTO' | 'CODELIST' {
    return this.M.groupMode;
  }

  protected grouppsappdefield: IPSAppDEField;
  getGroupPSAppDEField(): IPSAppDEField | null {
    return (
      this.grouppsappdefield ||
      (this.grouppsappdefield = this.fillObjectModel(
        S._1,
        this.M.getGroupPSAppDEField,
        S._34c,
      ) as IPSAppDEField)
    );
  }

  protected grouppscodelist: IPSAppCodeList;
  getGroupPSCodeList(): IPSAppCodeList | null {
    return (
      this.grouppscodelist ||
      (this.grouppscodelist = this.fillObjectModel(
        S._8,
        this.M.getGroupPSCodeList,
        S._34d,
      ) as IPSAppCodeList)
    );
  }

  protected grouppssyscss: IPSSysCss;
  getGroupPSSysCss(): IPSSysCss | null {
    return (
      this.grouppssyscss ||
      (this.grouppssyscss = this.fillObjectModel(
        S._278,
        this.M.getGroupPSSysCss,
        S._34e,
      ) as IPSSysCss)
    );
  }

  protected grouppssyspfplugin: IPSSysPFPlugin;
  getGroupPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.grouppssyspfplugin ||
      (this.grouppssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getGroupPSSysPFPlugin,
        S._34f,
      ) as IPSSysPFPlugin)
    );
  }

  protected grouppsuiactiongroup: IPSUIActionGroup;
  getGroupPSUIActionGroup(): IPSUIActionGroup | null {
    return (
      this.grouppsuiactiongroup ||
      (this.grouppsuiactiongroup = this.fillObjectModel(
        S._210,
        this.M.getGroupPSUIActionGroup,
        S._350,
      ) as IPSUIActionGroup)
    );
  }

  get groupWidth(): number {
    return this.M.groupWidth != null ? this.M.groupWidth : 0;
  }

  protected itempslayoutpanel: IPSLayoutPanel;
  getItemPSLayoutPanel(): IPSLayoutPanel | null {
    return (
      this.itempslayoutpanel ||
      (this.itempslayoutpanel = this.fillObjectModel(
        S._255,
        this.M.getItemPSLayoutPanel,
        S._351,
      ) as IPSLayoutPanel)
    );
  }

  protected itempssyscss: IPSSysCss;
  getItemPSSysCss(): IPSSysCss | null {
    return (
      this.itempssyscss ||
      (this.itempssyscss = this.fillObjectModel(
        S._278,
        this.M.getItemPSSysCss,
        S._352,
      ) as IPSSysCss)
    );
  }

  protected itempssyspfplugin: IPSSysPFPlugin;
  getItemPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.itempssyspfplugin ||
      (this.itempssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getItemPSSysPFPlugin,
        S._353,
      ) as IPSSysPFPlugin)
    );
  }

  get minorSortDir(): 'ASC' | 'DESC' {
    return this.M.minorSortDir;
  }

  protected minorsortpsappdefield: IPSAppDEField;
  getMinorSortPSAppDEField(): IPSAppDEField | null {
    return (
      this.minorsortpsappdefield ||
      (this.minorsortpsappdefield = this.fillObjectModel(
        S._1,
        this.M.getMinorSortPSAppDEField,
        S._2b9,
      ) as IPSAppDEField)
    );
  }

  protected ordervaluepsappdefield: IPSAppDEField;
  getOrderValuePSAppDEField(): IPSAppDEField | null {
    return (
      this.ordervaluepsappdefield ||
      (this.ordervaluepsappdefield = this.fillObjectModel(
        S._1,
        this.M.getOrderValuePSAppDEField,
        S._354,
      ) as IPSAppDEField)
    );
  }

  protected psdedataviewdataitems: IPSDEDataViewDataItem[];
  getPSDEDataViewDataItems(): IPSDEDataViewDataItem[] | null {
    return (
      this.psdedataviewdataitems ||
      (this.psdedataviewdataitems = this.fillChildListModel(
        this.M.getPSDEDataViewDataItems,
        S._28d,
      ) as IPSDEDataViewDataItem[])
    );
  }

  findPSDEDataViewDataItem(objKey: any): IPSDEDataViewDataItem | null {
    return this.getPSModel5(
      S._28d,
      this.getPSDEDataViewDataItems(),
      objKey,
    ) as IPSDEDataViewDataItem;
  }

  protected psdedataviewitems: IPSDEDataViewItem[];
  getPSDEDataViewItems(): IPSDEDataViewItem[] | null {
    return (
      this.psdedataviewitems ||
      (this.psdedataviewitems = this.fillChildListModel(
        this.M.getPSDEDataViewItems,
        S._a4,
      ) as IPSDEDataViewItem[])
    );
  }

  findPSDEDataViewItem(objKey: any): IPSDEDataViewItem | null {
    return this.getPSModel5(
      S._a4,
      this.getPSDEDataViewItems(),
      objKey,
    ) as IPSDEDataViewItem;
  }

  get pagingSize(): number {
    return this.M.pagingSize;
  }

  hasWFDataItems(): boolean {
    return this.M.hasWFDataItems;
  }

  get appendDEItems(): boolean {
    return this.M.appendDEItems;
  }

  get enableCardEdit(): boolean {
    return this.M.enableCardEdit;
  }

  get enableCardEditGroup(): boolean {
    return this.M.enableCardEditGroup;
  }

  get enableCardEditOrder(): boolean {
    return this.M.enableCardEditOrder;
  }

  get enableCardNew(): boolean {
    return this.M.enableCardNew;
  }

  get enableGroup(): boolean {
    return this.M.enableGroup;
  }

  get enablePagingBar(): boolean {
    return this.M.enablePagingBar;
  }

  get noSort(): boolean {
    return this.M.noSort;
  }

  get singleSelect(): boolean {
    return this.M.singleSelect;
  }
  get cls(): string {
    return 'PSDEDataViewImpl';
  }
  instanceof(cls: string): boolean {
    if (
      cls == S._217 ||
      cls == S._214 ||
      cls == S._1f ||
      cls == S._24a ||
      cls == S._244 ||
      cls == S._245 ||
      cls == S._246 ||
      cls == S._24b
    )
      return true;
    return super.instanceof(cls);
  }
}
